package com.swanclouds.redfish.managers.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.managers.Ntp;

import java.util.Map;

public class NtpServiceModel implements Ntp {
    //NTP资源的访问路径
    @JsonProperty("@odata.id")
    private String dataId;

    //NTP资源的描述信息
    @JsonProperty("@odata.context")
    private String context;

     //NTP资源的类型
    @JsonProperty("@odata.type")
    private String type;

    //NTP的id
    @JsonProperty("Id")
    private String id;

    //NTP的名称
    @JsonProperty("Name")
    private String name;

    //NTP的描述信息
    @JsonProperty("Description")
    private String description;

    //NTP使能
    @JsonProperty("ServiceEnabled")
    private String serviceEnabled;

    //首选服务器地址
    @JsonProperty("PreferredNtpServer")
    private String preferredNtpServer;

     //备用服务器地址
    @JsonProperty("AlternateNtpServer")
    private String alternateNtpServer;

    //NTP模式
    //● Static
    //● IPv4
    //● IPv6
    @JsonProperty("NtpAddressOrigin")
    private String ntpAddressOrigin;

    //最小轮询间隔值，间隔时
    //间为2的幂次方秒， 如：6 （2^6=64 秒）。默认值
    //为6（64秒），取值范围
    //是3(8秒) 到17 (36小时)
    @JsonProperty("MinPollingInterval")
    private String minPollingInterval;

    //最大轮询间隔值，间隔时
    //间为2的幂次方秒， 如：6 （2^6=64 秒）。默认值
    //为10（17分钟），取值范
    //围是3(8秒) 到17 (36小 时)
    @JsonProperty("MaxPollingInterval")
    private String maxPollingInterval;

    //服务器身份认证
    @JsonProperty("ServerAuthenticationEnabled")
    private String serverAuthenticationEnabled;

    //
    @JsonProperty("DateTime")
    private String dateTime;

    //
    @JsonProperty("DateTimeLocalOffset")
    private String dateTimeLocalOffset;

     //时区
    @JsonProperty("TimeZone")
    private String timeZone;

    //NTP 同步周期分钟数
    @JsonProperty("NTPSynchronizationCycleMinutes")
    private String nTPSynchronizationCycleMinutes;

    //可操作资源
    @JsonProperty("Actions")
    private Map<String,Object> actions;


    @Override
    public String getDataId() {
        return this.dataId;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public String getContext() {
        return this.context;
    }

    @Override
    public String getType() {
        return this.type;
    }

    public String getDescription() {
        return description;
    }

    public String getServiceEnabled() {
        return serviceEnabled;
    }

    public String getPreferredNtpServer() {
        return preferredNtpServer;
    }

    public String getAlternateNtpServer() {
        return alternateNtpServer;
    }

    public String getNtpAddressOrigin() {
        return ntpAddressOrigin;
    }

    public String getMinPollingInterval() {
        return minPollingInterval;
    }

    public String getMaxPollingInterval() {
        return maxPollingInterval;
    }

    public String getServerAuthenticationEnabled() {
        return serverAuthenticationEnabled;
    }

    public String getDateTime() {
        return dateTime;
    }

    public String getDateTimeLocalOffset() {
        return dateTimeLocalOffset;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public String getnTPSynchronizationCycleMinutes() {
        return nTPSynchronizationCycleMinutes;
    }

    public Map<String, Object> getActions() {
        return actions;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "KvmServiceModel{" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", Description='" + description + '\'' +
                ", ServiceEnabled='" + serviceEnabled + '\'' +
                ", PreferredNtpServer='" + preferredNtpServer + '\'' +
                ", AlternateNtpServer='" + alternateNtpServer + '\'' +
                ", NtpAddressOrigin='" + ntpAddressOrigin + '\'' +
                ", MinPollingInterval='" + minPollingInterval + '\'' +
                ", MaxPollingInterval='" + maxPollingInterval + '\'' +
                ", ServerAuthenticationEnabled='" + serverAuthenticationEnabled + '\'' +
                ", DateTime='" + dateTime + '\'' +
                ", DateTimeLocalOffset='" + dateTimeLocalOffset + '\'' +
                ", TimeZone='" + timeZone + '\'' +
                ", NTPSynchronizationCycleMinutes='" + nTPSynchronizationCycleMinutes + '\'' +
                ", Actions='" + actions + '\'' +
                '}';
    }
}
